package cn.shadow.produce.purchase.controller;

import cn.shadow.produce.purchase.model.dao.PurchaseOrderExample;
import cn.shadow.produce.purchase.model.dao.PurchaseOrderMapper;
import cn.shadow.produce.purchase.model.entity.PurchaseOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private PurchaseOrderMapper purchaseOrderMapper;

    @GetMapping("/demo")
    public List<PurchaseOrder> demo(){
        PurchaseOrderExample example = new PurchaseOrderExample();
        PurchaseOrderExample.Criteria criteria = example.createCriteria();
        criteria.andIdIsNotNull();
        return purchaseOrderMapper.selectByExample(example);
    }

}
